<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>新增</title>
    <!--框架必需start-->
    <script type="text/javascript" src="../../libs/js/jquery.js"></script>
    <script type="text/javascript" src="../../libs/js/language/cn.js"></script>
    <script type="text/javascript" src="../../libs/js/framework.js"></script>
    <script type="text/javascript" src="../../assets/js/utils.js"></script>
    <link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" id="skin" prePath="../../"/>
    <link rel="stylesheet" type="text/css" id="customSkin"/>
    <!--框架必需end-->
    <!--self开始-->
    <link rel="stylesheet" href="../../assets/css/m_style.css" class="m_style">
    <style>
        #_DialogButtons_0fk{
            text-align: center;
        }
        #_ButtonCancel_0fk{
            display: none;
        }
    </style>
    <!--self结束-->
</head>
<body>
<div style="line-height: 250%" class="page_content">
    <div class="mdd_con">
      <ul class="set_a_t">
          <li>
              <span>员工ID:</span>
              <input type="text" name="name" id="name" placeholder="请输入姓名">
          </li>
          <li>
              <span>用户名:</span>
              <input type="text" name="username" placeholder="请输入用户名">
          </li>
          <li>
              <span>性别:</span>
              <input type="text" name="gender" placeholder="请输入性别">
          </li>
          <li>
              <span>用户权限:</span>
              <span class="set_c_b_manage set_c_b_manage_seled">超级管理员</span>
              <span class="set_c_b_manage">管理员</span>
          </li>
          <li>
              <span>电话:</span>
              <input type="text" name="phone" placeholder="请输入电话">
          </li>
          <li>
              <span>E-mail:</span>
              <input type="text" name="email" placeholder="请输入E-mail">
          </li>
          <li>
              <span>身份证号:</span>
              <input type="text" name="ID_number" placeholder="请输入身份证号">
          </li>
          <li>
              <span>员工卡号:</span>
              <input type="text" name="Employee_card_number" placeholder="请输入员工卡号">
          </li>
          <li>
              <span>部门编号:</span>
              <input type="text" name="level_id" placeholder="请输部门编号">
          </li>
          <li>
              <span>是否接收短信:</span>
              <span class="set_c_b_message set_c_b_message_seled" id="isNote">是</span>
              <span class="set_c_b_message" id="unNote">否</span>
          </li>
      </ul>
    </div>
</div>
<script>
    var ctx="http://www.chinalightning.com.cn/api/register/";


    $(".set_c_b_manage").click(function () {
        $(this).addClass("set_c_b_manage_seled").siblings().removeClass("set_c_b_manage_seled")
    })
    $(".set_c_b_message").click(function () {
        $(this).addClass("set_c_b_message_seled").siblings().removeClass("set_c_b_message_seled")
    })
    function updateData () {
        var Administrator_type="管理员";
        var is_note="否"
         if ( $("#super").hasClass("set_c_b_manage_seled"))
             Administrator_type="超级管理员";

         if ($("#isNote").hasClass("set_c_b_manage_seled"))
             is_note="是";

          var ob=$("input[type='text']");
          var parames={};


          for (let i=0 ;i<ob.length;i++){
              var obj=ob[i];

              if (obj.value==''){
                  alert(obj.placeholder)
                  return ;
              }
              parames[obj.name]=obj.value;
          }
        parames.is_note=is_note;
          parames.Administrator_type=Administrator_type;

         $.post(ctx, parames,function(res){

             if (res.message==200){
                 alert("添加成功");
             }else{
                 alert("添加失败");
             }
             top.Dialog.close();
        });



    }
</script>
</body>
</html>
